package com.example.replacebooks.mapper;

import com.example.replacebooks.entity.Class;
import com.example.replacebooks.entity.Notice;
import com.example.replacebooks.entity.Params;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface NoticeMapper extends Mapper<Notice> {
    List<Notice> findBySearch(@Param("params") Params params,@Param("role") Integer role);

    @Select("select * from notice where noticeid = #{noticeid} limit 1")
    Notice findByNoticeid(@Param("noticeid") Integer noticeid);

    @Update("update class set notice = #{notice},userid = #{userid} where noticeid = #{noticeid}")
    void updateByNoticeidid(Notice notice);
    @Select("select * from notice")
    List<Notice> selectall();
}

